package org.cainiao.notebook.dao.repository;

import org.cainiao.notebook.entity.Note;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

/**
 * <br />
 * <p>
 * Author: Cai Niao(wdhlzd@163.com)<br />
 */
public interface NoteRepository extends JpaRepository<Note, Long> {

    List<Note> findByDeletedFalseAndSystemUserIdAndParentIdAndExternalId(String systemUserId,
                                                                         long parentId, String externalId);

    List<Note> findByDeletedFalseAndSystemUserIdAndParentId(String systemUserId, long parentId);

    Optional<Note> findOneByDeletedFalseAndSystemUserIdAndId(String systemUserId, long id);
}
